package com.student.service;

import com.student.dao.UserMapper;
import com.student.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @author 是一个鸽子啊
 * @date 2020/4/14
 * @qq 364826415
 */
@Service
public class UserServiceImpl implements UserService {
    private UserMapper userMapper;
    @Autowired
    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public User loginUser(String userName, String userPassword) {
        return userMapper.loginUser(userName,userPassword);
    }

    @Override
    public List<User> queryUserList() {
        return userMapper.queryUserList();
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public List<User> queryUserByUserRname(String userRname) {
        return userMapper.queryUserByUserRname(userRname);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public User queryUserByUserName(String userName) {
        return userMapper.queryUserByUserName(userName);
    }

    @Override
    public int delUser(String userID) {
        return userMapper.delUser(userID);
    }

    @Override
    public User queryUserByID(int userID) {
        return userMapper.queryUserByID(userID);
    }
}
